<?php

use think\seecms\Dispatch;
use think\seecms\middleware\AuthorizationMiddleware;
use think\seecms\middleware\IsLoginMiddleware;
use think\seecms\middleware\PermissionMiddleware;
use think\facade\Route;
use seecms\controller\User;

$callable = function () {
    // 修改首页
    //Route::any('home/main', '\app\admin\controller\Main@index');
    // 自定义调度
    Route::any(':controller/:action', Dispatch::class);
};
# 快捷登录路由
Route::any('/', User::class . '@login')->middleware([IsLoginMiddleware::class]);
Route::any('/login', User::class . '@login')->middleware([IsLoginMiddleware::class]);
Route::any('/logout', User::class . '@logout');
// 用户登录登出
Route::any('user/:action', Dispatch::class);

Route::group('/', $callable)->middleware([AuthorizationMiddleware::class, PermissionMiddleware::class]);;
// 域名绑定模式，需配置domain_bind，如果使用了映射模式(配置app_map)，把admin修改成映射值即可
//Route::group('/admin', $callable);



